package com.dianqu.weather.core.model;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Component;

@Component
public class ClientManager {

	Map<String, Integer> onlineClient = new HashMap<String, Integer>();

	public void addOnlineClient(HttpSession session) {
		onlineClient.put(session.getId(), 0);
	}

	public void removeOnlineClient(HttpSession session) {
		onlineClient.remove(session.getId());
	}

	public int totalOnlineClient() {
		return onlineClient.size();
	}

}
